<?php

declare(strict_types=1);

namespace App\Entities;

class OrderReportImageEntity extends ABaseEntity
{
    public function __construct(OrderReportImageModel $model)
    {
        $this->model = $model;
    }

    /**
     * @return array
     */
    public static function getImagesByReportId(int $reportId)
    {
        $ret = OrderReportImageModel::where('order_report_id', $reportId)->get()->toArray();
        if (empty($ret)) {
            return [];
        }

        return array_column($ret, 'image');
    }

    public function getOrderReportId(): int
    {
        return $this->model->order_report_id;
    }

    public function setOrderReportId(int $order_report_id): void
    {
        $this->model->order_report_id = $order_report_id;
    }

    public function getImage(): string
    {
        return $this->model->image;
    }

    public function setImage(string $image): void
    {
        $this->model->image = $image;
    }
}
